<?php
include "./../vendor/autoload.php";

$s = isset($_GET['s'])?explode('/',$_GET['s']):['Index','index'];

$controller = isset($s[0])?ucfirst($s[0]):'Index';
$action = isset($s[1])?$s[1]:'index';

$psid = isset($s[2])?$s[2]:1;

$_SESSION['psid'] = $psid;

$class = "\\app\\controller\\{$controller}";

if(!class_exists($class)){
    exit("Controller 不存在");
}
$app  = new $class();
if(!method_exists($app,$action)){
    exit("method 不存在");
}

$app->$action();
